// 禁止不必要的嵌套var isYes = answer === 1?true: false;
const answer = 2,
  isYes = answer === 1 ? true : false;

console.log(isYes);
